<template>
    <top v-if="isRouterAlive"></top>
    <Header></Header>
    <router-view></router-view>
    <bottomvue></bottomvue>
</template>

<script>
import Header from "./components/header.vue";
import bottomvue from "./components/bottom.vue";
import top from "./components/top.vue";
import { useRouter } from "vue-router";
import { ref ,nextTick,provide} from "vue";
export default {
  components: {
    Header,
    bottomvue,
    top
  },
  setup() {
    const router = useRouter();
    router.push({
      path: "/mainpage",
    });
    const isRouterAlive = ref(true);
    const reload = () => {
      isRouterAlive.value = false;
      nextTick(() => {
        isRouterAlive.value = true;
      });
    };
    provide("reload", reload);
    return {
      isRouterAlive,
    };
  },
};
</script>

<style scoped>
</style>